<?php
namespace Admin\Model;

use Zend\Db\TableGateway\TableGateway;
use Admin\Model\BaseTable;
use \Zend\Db\Sql\Select;

class ProductTable extends BaseTable
{
	public function __construct(TableGateway $tableGateway) {
		parent::__construct($tableGateway);
	}
	
	public function fetchAll() {
		
		$rowset = $this->tableGateway->select(function(Select $select){
			$select->join(array('c'=>'category'),'product.p_id=c.id',array('category'	=> 'name'));
//			die;
		});
		//$rowset = $this->tableGateway->select(function($select){});
		return $rowset;
	}
}